package com.konne.nightmare.FastPublicOpinion.ui.information.activity;


import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.TextView;

import com.gyf.immersionbar.ImmersionBar;
import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpActivity;
import com.konne.nightmare.FastPublicOpinion.bean.CurrencyBean;
import com.konne.nightmare.FastPublicOpinion.bean.LoginBean;
import com.konne.nightmare.FastPublicOpinion.http.BaseResponse;
import com.konne.nightmare.FastPublicOpinion.mvp.presenter.LoginPresenter;
import com.konne.nightmare.FastPublicOpinion.mvp.view.ILoginView;
import com.konne.nightmare.FastPublicOpinion.utils.LoadProgressDialog;
import com.konne.nightmare.FastPublicOpinion.utils.StringUtils;
import com.konne.nightmare.FastPublicOpinion.utils.ToastUtil;
import com.konne.nightmare.FastPublicOpinion.utils.Utils;

import butterknife.BindView;
import butterknife.OnClick;

public class OldUser_LoginActivity extends BaseMvpActivity<ILoginView, LoginPresenter> implements ILoginView, View.OnClickListener {



    @Override
    protected LoginPresenter createPresenter() {
        return new LoginPresenter();
    }

    @Override
    public int getLayout() {
        return R.layout.activity_old_user_login;
    }

    @Override
    public void initView() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
        }
    }

    @Override
    public void initData(Bundle savedInstanceState) {
    }

    @Override
    public LoadProgressDialog getLoadDialog() {
        return dialog;
    }

    @Override
    public void cancelLoadDialog() {
        if (dialog != null && dialog.isShowing()) {
            dialog.cancel();
        }
    }

    @OnClick({R.id.login,R.id.qh_txt})
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.login:
                Intent intent = new Intent();
                intent.setClass(this, MainActivity.class);
                startActivity(intent);
                finish();
                break;
            case R.id.qh_txt:
                Intent qh_txt = new Intent();
                qh_txt.setClass(this, LoginActivity.class);
                startActivity(qh_txt);
                finish();
                break;
        }


    }

    @Override
    public void login(BaseResponse<LoginBean.DataBean> data) {

    }

    @Override
    public void getPhoneActivationMsg(BaseResponse<CurrencyBean> data) {

    }

    @Override
    public String msg() {
        return null;
    }

    @Override
    public String phoneNumber() {
        return null;
    }
}
